package org.lemon.cla.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Min;
import lombok.Data;
import org.lemon.cla.enums.BookStatusEnum; // 导入图书状态枚举

import java.time.LocalDate;

@Data
@Schema(description = "图书创建请求对象")
public class BookCreateRequest {

    @NotBlank(message = "ISBN不能为空")
    @Schema(description = "ISBN (图书国标标号)", example = "978-7-121-12345-6", required = true)
    private String isbn;

    @NotBlank(message = "书名不能为空")
    @Schema(description = "书名", example = "Spring Boot 实战", required = true)
    private String title;

    @Schema(description = "封面URL", example = "http://example.com/book_cover.jpg")
    private String coverUrl;

    @NotBlank(message = "作者不能为空")
    @Schema(description = "作者", example = "张三", required = true)
    private String author;

    @NotBlank(message = "出版社不能为空")
    @Schema(description = "出版社", example = "人民邮电出版社", required = true)
    private String publisher;

    @NotNull(message = "出版日期不能为空")
    @Schema(description = "出版日期", example = "2023-01-01", required = true)
    private LocalDate publishDate;

    @NotNull(message = "库存数量不能为空")
    @Min(value = 0, message = "库存数量不能小于0")
    @Schema(description = "库存数量", example = "100", required = true)
    private Integer totalCopies;

    // availableCopies 和 status 在创建时通常自动设置，不需客户端传入
    // location 可以选择性传入
    @Schema(description = "存放位置", example = "A区3层2排")
    private String location;
}